package chap_07;

import org.junit.jupiter.api.Test;

import java.util.concurrent.ForkJoinPool;
import java.util.concurrent.ForkJoinTask;
import java.util.stream.LongStream;
import java.util.stream.StreamSupport;

/**
 * 分支合并框架
 */
public class Run_02 {
    @Test
    public void test01() {
        long[] numbers = LongStream.rangeClosed(1, 10000).toArray();
        ForkJoinTask<Long> task = new ForkJoinSumCalculator(numbers);
        System.out.println(new ForkJoinPool().invoke(task));
    }


}
